TARGET = PortVideoSDL
CPPSOURCES = $(shell ls ./*.cpp ../common/*.cpp) 
CSOURCES = $(shell ls ../common/*.c)
CPPOBJECTS = $(CPPSOURCES:.cpp=.o)
COBJECTS = $(CSOURCES:.c=.o)


SDL_CFLAGS  := $(shell sdl-config --cflags)
SDL_LDFLAGS := $(shell sdl-config --libs)

COPTS  = -Wall -O3 -finline-functions -ffast-math -funroll-all-loops -fomit-frame-pointer
CDEBUG = -Wall -g
CFLAGS = $(COPTS) $(SDL_CFLAGS) -DLINUX
CXXFLAGS = $(INCLUDES) $(CFLAGS)

LIBS = $(SDL_LDFLAGS) -lraw1394 -ldc1394_control ./ccvt/libccvt.a 

all:	$(TARGET) 

$(TARGET) : $(CPPOBJECTS) $(COBJECTS)
	$(CXX) -o $@ $+ $(LIBS) 

clean:
	rm -f $(TARGET) $(CPPOBJECTS) $(COBJECTS)

run:	$(TARGET)
	./$(TARGET)

install: $(TARGET)
	install -d $(DESTDIR)$(BINDIR)
	install -d $(DESTDIR)$(PREFIX)/share/$(TARGET)
	install -m 755 -c $(TARGET) $(DESTDIR)$(BINDIR)
	install -m 644 -c ../readme.txt $(DESTDIR)$(PREFIX)/share/$(TARGET)
	install -m 644 -c ../license.txt $(DESTDIR)$(PREFIX)/share/$(TARGET)
